﻿@using BrnMall.Manager.Manager.Store
@{
    Layout = null;
}
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>小程序会员中心</title>
    <link href="/admin_store/css/admin_index.css?@DateTime.Now.Ticks" rel="stylesheet" />
    <script src="/admin_store/scripts/jquery.js"></script>
    <script src="http://wxpassport.711688.net.cn/Files/Scripts/V3/ajax-data.js"></script>
    <script src="http://wxpassport.711688.net.cn/Files/Scripts/V3/dialog.js"></script>
    <script src="/admin_store/scripts/admin_index.js?@DateTime.Now.Ticks"></script>
</head>
<body>
    <div id="body-top" class="service-tp">
        <a href="http://wxpassport.711688.net.cn/admin_index.aspx" title="后台首页"><img src="/admin_store/images/home/logo.png" /></a>
        <div class="admin-cro">
            <div  class="admin-cro-item">
                <img src="~/admin_store/images/home/03.png" id="admin-cro-item-imgs" />
                <a class='memu-redirect' data-url="/union/myInfo.aspx"><span id="nickName" class="nickName"></span></a>
            </div>
            <div class="admin-cro-item2">
                <img src="~/admin_store/images/home/02.png" alt="" class="admin-cro-item-img" />&nbsp;
                <a href="http://wxpassport.711688.net.cn/ajax/login.aspx?faction=loginout&backurl=http%3a%2f%2fpassport.711688.com.cn%2fajax%2flogin.aspx%3ffaction%3dloginout%26upath%3d3"><span style="color:black;">退出</span></a>
            </div>
        </div>
    </div>

    <!-- 导航栏 -->
    <div class="content-title">
        <div class="content-title-item gtype_15 hide" data-index="1">
            <img src="/admin_store/images/home/1.png" data-img="/admin_store/images/home/8.png" />
            <span>微信小程序</span>
        </div>
        <div class="content-title-item gtype_18 hide" data-index="2">
            <img src="/admin_store/images/home/2.png" data-img="/admin_store/images/home/9.png" />
            <span>小程序分销</span>
        </div>
        <div class="content-title-item gtype_20 hide" data-index="3">
            <img src="/admin_store/images/home/3.png" data-img="/admin_store/images/home/10.png" />
            <span>小程序推广</span>
        </div>
        <div class="content-title-item gtype_20 hide" data-index="4">
            <img src="/admin_store/images/home/4.png" data-img="/admin_store/images/home/11.png" />
            <span>公众号运营</span>
        </div>
        <div class="content-title-item gtype_20 hide" data-index="5">
            <img src="/admin_store/images/home/5.png" data-img="/admin_store/images/home/12.png" />
            <span>朋友圈推广</span>
        </div>
        <div class="content-title-item gtype_20  hide" data-index="6">
            <img src="/admin_store/images/home/6.png" data-img="/admin_store/images/home/13.png" />
            <span>小程序网站</span>
        </div>
        <div class="content-title-item nav_agent hide" data-index="7">
            <img src="/admin_store/images/home/7.png" data-img="/admin_store/images/home/14.png" />
            <span>代理管理</span>
        </div>
    </div>

    <div class="content-mid">

        <!--菜单栏-->
        <div class="nav-list">

            <!--小程序菜单-->
            <div class="nav-list-rank nav_1 hide">
                <div class="nav-list-rank-tit">
                    <img src="http://adminbata.711688.net.cn/admin_store/images/home/15.png" /><a href="javascript:;">首页定制</a>
                </div>
                <ul class="nav-ul hide">
                    <li><a class='memu-redirect' data-url="/storeadmin/weapp/preview">首页预览</a></li>
                    <li><a class='memu-redirect' data-url="/storeadmin/store/widgetconfiglist?code=index_banner">顶部轮播</a></li>
                    <li><a class='memu-redirect' data-url="/storeadmin/store/widgetconfiglist?code=index_nav_icon">分类导航</a></li>
                    <li><a class='memu-redirect' data-url="/storeadmin/store/widgetconfiglist?code=index_product">商品列表</a></li>
                    <li><a class='memu-redirect' data-url="/storeadmin/store/IndexPictureWidgetConfigList">图片组件</a></li>
                    <li><a class='memu-redirect' data-url='/storeadmin/weapp/StoreAppList'>底部导航</a></li>
                </ul>

                <div class="nav-list-rank-tit">
                    <img src="http://adminbata.711688.net.cn/admin_store/images/home/16.png" /><a href="javascript:;">商品管理</a>
                </div>
                <ul class="nav-ul hide">
                    <li><a class='memu-redirect' data-url="/storeadmin/product/AddProduct_New">添加商品</a></li>
                    <!--<li><a class='memu-redirect' data-url="/storeadmin/product/addsku">添加SKU</a></li>-->
                    <li><a class='memu-redirect' data-url="/storeadmin/product/onsaleproductlist">在售商品</a></li>
                    <li><a class='memu-redirect' data-url="/storeadmin/product/outsaleproductlist">下架商品</a></li>
                    <li><a class='memu-redirect' data-url="/storeadmin/product/timeproductlist">定时商品</a></li>
                    <li><a class='memu-redirect' data-url="/storeadmin/product/recyclebinproductlist">回收站</a></li>
                </ul>


                <div class="nav-list-rank-tit"><img src="http://adminbata.711688.net.cn/admin_store/images/home/17.png" /><a href="javascript:;">订单管理</a></div>
                <ul class="nav-ul hide">
                    <li><a class='memu-redirect' data-url="/storeadmin/order/orderlist">订单列表</a></li>
                    <li><a class='memu-redirect' data-url="/storeadmin/order/refundlist">退款列表</a></li>
                    <li><a class='memu-redirect' data-url="/storeadmin/order/DirectPayOrderList">当面付列表</a></li>
                    <li><a class='memu-redirect' data-url="/storeadmin/order/afterservicelist">售后服务</a></li>
                    <li><a class='memu-redirect' data-url="/storeadmin/order/printsettinglist">打印机设置</a></li>
                    <li><a class='memu-redirect' data-url="/storeadmin/order/autoprintlist">自动打印</a></li>
                </ul>

                <div class="nav-list-rank-tit"><img src="http://adminbata.711688.net.cn/admin_store/images/home/18.png" /><a href="javascript:;">促销活动</a></div>
                <ul class="nav-ul hide">
                    <li><a class='memu-redirect' data-url="/storeadmin/promotion/singlepromotionlist">单品促销</a></li>
                    <li><a class='memu-redirect' data-url="/storeadmin/promotion/buysendpromotionlist">买送促销</a></li>
                    <li><a class='memu-redirect' data-url="/storeadmin/promotion/giftpromotionlist">赠品促销</a></li>
                    <li><a class='memu-redirect' data-url="/storeadmin/promotion/suitpromotionlist">套装促销</a></li>
                    <li><a class='memu-redirect' data-url="/storeadmin/promotion/fullsendpromotionlist">满赠促销</a></li>
                    <li><a class='memu-redirect' data-url="/storeadmin/promotion/fullcutpromotionlist">满减促销</a></li>
                    <li><a class='memu-redirect' data-url="/storeadmin/coupon/coupontypelist">优惠劵</a></li>
                    <li><a class='memu-redirect' data-url="/storeadmin/promotion/GroupBuyList">团购活动</a></li>
                </ul>

                <div class="nav-list-rank-tit"><img src="http://adminbata.711688.net.cn/admin_store/images/home/19.png" /><a href="javascript:;">内容管理</a></div>
                <ul class="nav-ul hide">
                    <li><a class='memu-redirect' data-url="/storeadmin/news/newslist">内容列表</a></li>
                    <li><a class='memu-redirect' data-url="/storeadmin/news/newstypelist">内容分类</a></li>
                </ul>

                <div class="nav-list-rank-tit"><img src="http://adminbata.711688.net.cn/admin_store/images/home/20.png" /><a href="javascript:;">预约评价</a></div>
                <ul class="nav-ul hide">
                    <li><a class='memu-redirect' data-url="/storeadmin/productreview/productreviewlist">商品评价</a></li>
                    <li><a class='memu-redirect' data-url="/storeadmin/productappoint/productappointlist">预约列表</a></li>
                </ul>

                <div class="nav-list-rank-tit"><img src="http://adminbata.711688.net.cn/admin_store/images/home/21.png" /><a href="javascript:;">会员中心</a></div>
                <ul class="nav-ul hide">
                    <li><a class='memu-redirect' data-url="/storeadmin/user/list">会员列表</a></li>
                    <li><a class='memu-redirect' data-url="/storeadmin/userrank/list">会员等级</a></li>
                    <li class='li_other hide'><a class='memu-redirect' data-url="/storeadmin/BusinessCard/UserCardList">会员名片</a></li>
					<li class='li_other hide'><a class='memu-redirect' data-url="/storeadmin/BusinessCard/CardVerifyList">名片认证</a></li>
                    <li><a class='memu-redirect' data-url="/storeadmin/admingroup/list">管理员组</a></li>
                </ul>


                <div class="nav-list-rank-tit">
                    <img src="http://adminbata.711688.net.cn/admin_store/images/home/22.png" />
                    <a href="javascript:;">报表统计</a>
                </div>
                <ul class="nav-ul hide">
                    <li><a class='memu-redirect' data-url="/storeadmin/stat/productstat">商品统计</a></li>
                    <li><a class='memu-redirect' data-url="/storeadmin/stat/saleproductlist">销售明细</a></li>
                    <li><a class='memu-redirect' data-url="/storeadmin/stat/orderstat">订单统计</a></li>
                </ul>

                <div class="nav-list-rank-tit">
                    <img src="http://adminbata.711688.net.cn/admin_store/images/home/23.png" />
                    <a href="javascript:;">店铺管理</a>
                </div>
                <ul class="nav-ul hide">
                    <li><a class='memu-redirect' data-url="/storeadmin/store/editstore">店铺信息</a></li>
                    <li><a class='memu-redirect' data-url="/storeadmin/store/storeclasslist">店铺分类</a></li>
                    <li><a class='memu-redirect' data-url="/storeadmin/store/storeshiptemplatelist">配送模板</a></li>
                    <li><a class='memu-redirect' data-url="/storeadmin/store/storewxapp">小程序设置</a></li>
                    <li><a class='memu-redirect' data-url="/storeadmin/set/credit">积分设置</a></li>
                    <li><a class='memu-redirect' data-url="/storeadmin/cashitem/list">充值活动</a></li>
                    <li><a class='memu-redirect' data-url="/storeadmin/cashorder/list">充值记录</a></li>
                    <li><a class='memu-redirect' data-url="/storeadmin/cash/reportsearch">财务查询</a></li>
                    <li><a class='memu-redirect' data-url="/storeadmin/store/branchlist?pagesize=50">门店管理</a></li>
                    <li><a class='memu-redirect' data-url="/storeadmin/Restaurant/DiningTableList">餐位设置</a></li>
                    <li><a class='memu-redirect' data-url="/storeadmin/Restaurant/LineItemList">排队项设置</a></li>
                    <li><a class='memu-redirect' data-url="/userinfo/noticeset.aspx">小程序通知</a></li>
                    <li><a class='memu-redirect' data-url="/appapplication/list.aspx">小程序列表</a></li>
                    <!--<a href="/storeadmin/cash/cashrecordlist">会员收支</a>-->
                </ul>

                <div class="nav-list-rank-tit">
                    <img src="http://adminbata.711688.net.cn/admin_store/images/home/24.png" />
                    <a href="javascript:;">留言管理</a>
                </div>
                <ul class="nav-ul hide">
                    <li><a class='memu-redirect' data-url="/storeadmin/Message/MessageRow">留言列表</a></li>
                    <li><a class='memu-redirect' data-url="/storeadmin/Message/CreateDesign">创意定制</a></li>
                </ul>
            </div>

            <!--小程序分销-->
            @if (StoreInfoManager.CheckDistributor(WorkContext.StoreId))
            {
                <div class="nav-list-rank nav_2 hide">
                    <div class="nav-list-rank-tit"><img src="/admin_store/images/home/17.png" /><a href="javascript:;">分销管理</a></div>
                    <ul class="nav-ul" style="display:none">
                        <li><a class="memu-redirect" data-url="/storeadmin/distributor/BrokerageRequestApproveList">申请提现</a></li>
                        <li><a class="memu-redirect" data-url="/storeadmin/distributor/BrokerageRequestList">提现记录</a></li>
                        <li><a class="memu-redirect" data-url="/storeadmin/distributor/BrokerageList">佣金明细</a></li>
                        <li><a class="memu-redirect" data-url="/storeadmin/distributor/DistributorList">分销商列表</a></li>
                        <li><a class="memu-redirect" data-url="/storeadmin/distributor/DisGradeList">分销商等级</a></li>
                        <li><a class="memu-redirect" data-url="/storeadmin/distributor/OpenAgent">代理商开通</a></li>
                        <li><a class="memu-redirect" data-url="/storeadmin/distributor/AgentList">代理商列表</a></li>
                        <li><a class="memu-redirect" data-url="/storeadmin/distributor/AgentGradeList">代理商等级</a></li>
                    </ul>
                </div>
            }

            <!--小程序推广-->
            <div class="nav-list-rank nav_3 hide">
                <div class="nav-list-rank-tit">
                    <img src="http://adminbata.711688.net.cn/admin_store/images/home/17.png" />
                    <a href="javascript:void(0)">小程序推广</a>
                </div>
                <ul class="nav-ul" style="display:none">
                    <li><a class='memu-redirect' data-url="/product/listdyb.aspx">搜一搜推广</a></li>
                    <li><a class='memu-redirect' data-url="/userinfo/CompanyProfile.aspx">企业名片</a></li>
                    <li><a class='memu-redirect' data-url="/htmldoc/menusetting.html">菜单设置</a></li>
                </ul>
            </div>

            <!--公众号运营-->
            <div class="nav-list-rank nav_4 hide">
                <div class="nav-list-rank-tit">
                    <img src="http://adminbata.711688.net.cn/admin_store/images/home/15.png" />
                    <a href="javascript:;">文章管理</a>
                </div>
                <ul class="nav-ul" style="display:none">
                    <li><a class="memu-redirect" data-url="/Product/listdyb.aspx?t=2">草稿</a></li>
                    <li><a class="memu-redirect" data-url="/Product/listdyb.aspx?t=3">置顶文章</a></li>
                    <li><a class="memu-redirect" data-url="/Product/listdyb.aspx">产品文章</a></li>
                </ul>

                <div class="nav-list-rank-tit">
                    <img src="http://adminbata.711688.net.cn/admin_store/images/home/15.png" /><a href="javascript:;">自助采集</a>
                </div>
                <ul class="nav-ul" style="display:none">
                    <li><a class="memu-redirect" data-url="/Article/ArticleList.aspx?type=link">链接</a></li>
                    <li><a class="memu-redirect" data-url="/Article/ArticleList.aspx?type=wx">公众号</a></li>
                    <li><a class="memu-redirect" data-url="/Article/ArticleList.aspx?type=keyword">关键词</a></li>
                </ul>

                <div class="nav-list-rank-tit">
                    <img src="http://adminbata.711688.net.cn/admin_store/images/home/15.png" /><a href="javascript:;">素材库</a>
                </div>
                <ul class="nav-ul" style="display:none">
                    <li><a  class="memu-redirect" data-url="/Article/ArticleList.aspx">素材库</a></li>

                </ul>

                <div class="nav-list-rank-tit">
                    <img src="http://adminbata.711688.net.cn/admin_store/images/home/15.png" /><a href="javascript:;">设置中心</a>
                </div>
                <ul class="nav-ul" style="display:none">
                    <li><a class="memu-redirect" data-url="/userinfo/pushset.aspx">推送设置</a></li>
                    <li><a class="memu-redirect" data-url="/userinfo/timeset.aspx">定时设置</a></li>
                    <li><a class="memu-redirect" data-url="/userinfo/ApiWeixin.aspx">公众号授权</a></li>
                </ul>

                <div class="nav-list-rank-tit">
                    <img src="http://adminbata.711688.net.cn/admin_store/images/home/15.png" /><a href="javascript:;">发布记录</a>
                </div>
                <ul class="nav-ul" style="display:none">
                    <li><a class="memu-redirect" data-url="/product/list_wx_log.aspx">发布记录</a></li>
                </ul>
            </div>

            <!--朋友圈推广-->
            <div class="nav-list-rank nav_5 hide">
                <div class="nav-list-rank-tit"><img src="http://adminbata.711688.net.cn/admin_store/images/home/17.png" /><a href="javascript:void(0)">朋友圈推广</a></div>
                <ul class="nav-ul" style="display:none">
                    <li><a class='memu-redirect' data-url="/wjx/bind.html">微街秀</a></li>
                    <li><a class='memu-redirect' data-url="/htmldoc/guangdiantong.html">广点通</a></li>
                </ul>
            </div>

            <!--小程序网站-->
            <div class="nav-list-rank nav_6 hide">
                <div class="nav-list-rank-tit"><img src="http://adminbata.711688.net.cn/admin_store/images/home/17.png" /><a href="javascript:void(0)">小程序网站</a></div>
                <ul class="nav-ul" style="display:none">
                    <li><a class="memu-redirect" data-url="/storeadmin/pc/preview">首页定制</a></li>
                    <li><a class="memu-redirect" data-url="/storeadmin/pc/widgetconfiglist?code=pc_index_nav">网站导航</a></li>
                    <li><a class="memu-redirect" data-url="/storeadmin/pc/widgetconfiglist?code=pc_index_banner">顶部轮播</a></li>
                    <li><a class="memu-redirect" data-url="/storeadmin/pc/widgetconfiglist?code=index_product">首页商品</a></li>
                    <li><a class="memu-redirect" data-url="/storeadmin/pc/WidgetConfigList?code=pc_index_news">首页内容</a></li>
                    <li><a class="memu-redirect" data-url="/htmldoc/pc/pc_download.html">资源下载</a></li>
                </ul>
            </div>

            <!--代理菜单-->
            <div class="nav-list-rank nav_7 hide">
                <div class="nav-list-rank-tit"><img src="http://adminbata.711688.net.cn/admin_store/images/home/17.png" /><a href="javascript:void(0)">代理商</a></div>
                <ul class="nav-ul" style="display:none">
                    <li><a class="memu-redirect" data-url="/agent/weapp_clientlist.aspx">客户列表</a></li>
                    <li><a class="memu-redirect" data-url="/financial/bankroll.aspx">交易记录</a></li>
                    <li><a class="memu-redirect" data-url="/agent/modifyinfo_dyb.aspx">代理商信息</a></li>
                    <li class="agent-kind hide"><a class="memu-redirect" data-url="/agent/down-list.aspx?grouptype=15">经销商管理</a></li>
                </ul>
            </div>
        </div>

        <!--右侧框架-->
        <div class="content-detail">
            <div class="box-iframe"></div>
            <iframe id="frameRight" name="frameRight" src="" width="100%" height="100%" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" onLoad="iFrameHeight('frameRight')"></iframe>
        </div>


        <div style="height:20px;"></div>
        <script type="text/javascript">
            var isWeapp = false, isDis = false, isAgent = false, isProject = false;

            $(function () {
                if (!isLogin()) { toLogin(); return; }
                loadIframe();
                loadGroup();
                loadAgentMenu();
                bindBtn();
            })

            function bindBtn() {

                //菜单点击事件
                $(".nav-ul li a").click(function () {
                    //选中效果
                    $(".nav-ul li").removeClass("cur");
                    $(this).parent().addClass("cur");
                    //平滑定位
                    $('html, body').animate({ scrollTop: $('#body-top').offset().top }, 250)
                    //跳转页面
                    redirectFrame($(this));
                });

                //导航栏事件
                $('.content-title-item').click(function () {
                    $('.content-title-item').removeClass("on");

                    $(".content-title-item img").each(function () {
                        var old_src = $(this).attr("data-oldimg");
                        if (old_src != null)
                            $(this).attr("src", old_src);
                        else
                            $(this).attr("data-oldimg", $(this).attr("src"));
                    });

                    //选中的图片
                    $(this).addClass("on");
                    $('.content-title .on').find("img").each(function () {
                        $(this).attr("src", $(this).attr("data-img"));
                    });

                    //展开菜单栏
                    var index = $(this).attr("data-index");
                    $(".nav-list-rank").addClass("hide");
                    $(".nav_" + index).removeClass("hide");

                    //展开第一个菜单项
                    var firstUL = $(".nav_" + index + " .nav-ul").eq(0);
                    if (firstUL.css("display") == "none")
                        $(".nav_" + index + " .nav-list-rank-tit a").eq(0).click();
                });

                // 子菜单展开事件
                $('.nav-list-rank-tit a').on('click', function () {
                    $(this).parent('div').next('ul').slideToggle(100);
                });
                //账户点击事件
                $("#body-top .memu-redirect").click(function () {
                    redirectFrame($(this));//跳转页面
                })

            }

            //加载版本
            function loadGroup() {
                var userid = getUserId();
                ajaxJsonp(domainInfo.apiDomain + "/user.ashx?userid=" + userid + "&method=getusergroup&format=jsonp", "", function (data) {
                    if (data.Code != jsonCode.success) {
                        toast.show(data.Message);
                        alert(data.Message)
                        return;
                    }

                    var groupList = data.Data.list;
                    if (groupList != null) {
                        for (var i = 0; i < groupList.length; i++) {
                            var item = groupList[i];
                            if (item.GroupType >= 15 && item.GroupType <= 19) {
                                isWeapp = true;   //小程序
                                $(".expiration").html(item.ExpireTime.substring(0, 10));
                            }
                            if (item.GroupType == 18)
                                isDis = true;     //分销版

                            //小程序方案
                            if (item.GroupType == 20) {
                                isWeapp = true;
                                isProject = true;
                            }
                        }

                    }

                    if (data.Data != null) {
                        $(".userid").html(userid);
                        $(".nickName").html(data.Data.username);
                        $(".sitename").html(data.Data.sitename);
                        $(".regtime").html(data.Data.regtime.substring(0, 10));
                    }
                    loadContact();
                    loadMenu(); //加载菜单
                    setMenu();  //选中第一个菜单
                })
            }



            //加载代理
            function loadAgentMenu() {
                var kind = getCookies("ua", "kind");
                if (kind == 0)
                    $(".agent-kind").removeClass("hide");

                if (isGrant(15) || isGrant(16) || isGrant(16) || isGrant(19)) {
                    isAgent = true;
                    $(".gtype_15").removeClass("hide");
                }
                if (isGrant(9)) {
                    isAgent = true;
                    $(".gtype_9").removeClass("hide");
                }
                if (isGrant(11)) {
                    isAgent = true;
                    $(".gtype_11").removeClass("hide");
                }
                if (isGrant(13)) {
                    isAgent = true;
                    $(".gtype_13").removeClass("hide");
                }
            }

            function isGrant(key) {
                return getCookies("ua", key) != "" ? true : false;
            }

            //加载联系方式
            function loadContact() {
                var userid = getCookies("shtusers", "UserID");
                var kind = getCookies("ua", "kind") == "" ? "-1" : getCookies("ua", "kind");

                if (!document.location.href.indexOf(domainInfo.shtDomain) == -1)
                    return;

                if (userid == '' || isNaN(userid)) {
                    console.log("加载联系方式：缺少参数");
                    return;
                }

                ajaxJsonp(domainInfo.apiDomain + "/user.ashx?action=getusercontact&userid=" + userid + "&kind=" + kind + "&format=jsonp&rand=" + Math.round(), "", function (data) {
                    if (data.Code != jsonCode.success) {
                        toast.show(data.Message);
                        return;
                    }
                    var item = data.Data;
                    $(".kf_sitename").html(item.sitename);
                    $(".kf_number").html(item.number);
                    $(".kf_phone").html(item.phone);
                    $(".kf_email").html(item.email);
                    $(".kf_qq").html(item.qq);
                })
            }

        </script>
</body>
</html>
